package edu.gatech.cs2340.bytebankers.model;

import java.io.Serializable;

import edu.gatech.cs2340.bytebankers.model.profession.IProfession;

public class Leader extends Player implements Serializable {
	
	private IProfession profession;
	private double moneyLeft;
	
	/**
	 * Getter for the profession.
	 * @return The profession.
	 */
	public IProfession getProfession() {
		return profession;
	}
	
	/**
	 * Setter for profession.
	 * @param profession The profession to set.
	 */
	public void setProfession(IProfession profession) {
		this.profession = profession;
		this.moneyLeft = profession.getStartSalary();
	}
	
	/**
	 * Getter for money left.
	 * @return The amount of money left.
	 */
	public double getMoneyLeft() {
		return moneyLeft;
	}
	
	/**
	 * Add money to the leader's account
	 * @param amount The amount to add.
	 * @return The amount of money the leader has after deposit.
	 */
	public double depositMoney(double amount) {
		moneyLeft += amount;
		System.out.println("Deposited " + amount + " dollars into leader's account.");
		return moneyLeft;
		
	}
	
	/**
	 * Remove money from the leader's account
	 * @param amount The amount to remove.
	 * @return The amount of money the leader has after withdrawl.
	 */
	public double withdrawMoney(double amount) {
		moneyLeft -= amount;
		System.out.println("Withdrew " + amount + " dollars into leader's account.");
		return moneyLeft;
	}
	
	public String toString() {
		String string = "\n";
		string += "Name: " + this.getName() + "\n";
		string += "Profession: " + this.getProfession() + "\n";
		string += "Health: " + this.getHealth() + "\n";
		return string;
	}
	
}
